package org.kitrum.example.spring.alias;

import org.springframework.core.SimpleAliasRegistry;

import java.util.Arrays;

/**
 * @author : Kun
 * @version : 1.0
 * @date : 2021/01/23 10:46
 **/
public class AliasApplication {
    public static void main(String[] args) {
        SimpleAliasRegistry registry = new SimpleAliasRegistry();
        registry.registerAlias("userService","user");
        registry.registerAlias("userService","user_A");
        registry.registerAlias("user_A","user_AB");
        System.out.println(registry.isAlias("user"));
        System.out.println(registry.hasAlias("user","user"));
        System.out.println(Arrays.toString(registry.getAliases("userService")));
        System.out.println(registry.canonicalName("user"));
        registry.resolveAliases(String::toLowerCase);
        System.out.println(Arrays.toString(registry.getAliases("userservice")));
    }
}
